<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%--
 /**
  功能名称:修改用户信息
  
  创建人:
*/
--%>
<%
String path = request.getContextPath();
%>
<html>
  <head>
    <title>修改用户信息</title>
	<link href="<%=path%>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script language="javascript" src="<%=path %>/js/syAjax.js"></script>
	<script language="javascript" src="<%=path %>/js/validate.js"></script>
	<script src="<%=path%>/dwr/engine.js"></script>
    <script src="<%=path%>/dwr/util.js"></script>
    <script src="<%=path%>/dwr/interface/shiyueDwr.js"></script>
	<script type="text/javascript">
      	function doSubmitForm(){
      	if(document.getElementById('name').value.length==0 || document.getElementById('name').value.length>25){
				alert('姓名不能为空，且必须小于25个字符');
				return;
			}
			if(!isNumOrEng(document.getElementById('account'))){
				alert('请输入合法的用户名');
				return;
			}
			if(document.getElementById('address').value.length>50){
				alert('家庭地址必须小于50个字符');
				return;
			}
			
			//闷男 根据周总2011-7-5测试报告267条 去掉 电话数字验证 身份证验证
			
			var account = document.getElementById('account').value;
			var name = document.getElementById('name').value;
			var pwd = document.getElementById('pwd').value;
			var mobileNumber1 = document.getElementById('mobileNumber1').value;
			var idNumber = document.getElementById('idNumber').value;
			var email = document.getElementById('email').value;
			var address = document.getElementById('address').value;
			var sex = document.getElementById('sex').value;
			syAjax.request("post","<%=path %>/updateUserAction.action","user.status=${user.status}&user.userId=${user.userId}&user.userType=${user.userType}&user.account="+account+"&user.name="+name+"&user.password="+pwd+"&user.sex="+sex+"&user.mobileNumber1="+mobileNumber1+"&user.idNumber="+idNumber+"&user.email="+email+"&user.address="+address,{success:initSuccessResult,fail:onFail,type:'plain'});
		}
		
		function initSuccessResult(response){
			if(response=="true"){
				window.returnValue='true';
				window.close();
			}
		}
		function onFail(){
			alert('网络繁忙，请稍后再试');
		}
		
		function load(){
			shiyueDwr.findCodeHTMLByCodeMaintenanceTypeId("sex","user.sex",getsexCallBack);//性别
		}	
		//性别
	    function getsexCallBack(map)
	    {
	        document.getElementById("sexspan").innerHTML=map;
	        if('${user.sex}'!="")
	        {
	          document.getElementById("sex").value="${user.sex}";
	        }
	    }
	    
	   	//2011-7-18 闷男 按回车键跳到下一元素
		function document.onkeydown(){
		if(event.keyCode==13)
			if(document.activeElement && document.activeElement.type=='button') {
				doSubmitForm();
			}else {
				event.keyCode=9;
			}
		}
	    function ckz(z) {
			var arr = z.match(/^\d+$/);
			if(arr==null) {
				return false;
			}else {
				return true;
			}
		}
		
	</script>
  </head>
  
  <body bgcolor="#ECE9D8" onload="load();">
  <form action="<%=path%>/updateUserAction.action" method="post">
  <input type="hidden" name="user.userId" value="${user.userId }" />
  <input type="hidden" name="user.userType" value="${user.userType }" />
  <input type="hidden" name="user.status" value="${user.status }" />
    <table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" align="left" valign="bottom" bgcolor="#ECE9D8" class="f_8">&nbsp;&nbsp;&nbsp;&nbsp;注：<span class="f_11">*</span>为必填项</td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#ECE9D8"><table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ABA899"></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#FFFFFF"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="left" valign="top" bgcolor="#ECE9D8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15%" height="30" align="right"><span class="f_8"><span class="f_11">*</span></span> 人事编号：</td>
        <td width="26%" align="left">${user.userId }</td>
        <td width="56%" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left">&nbsp;</td>
          </tr>
        </table></td>
        <td width="3%" align="left">&nbsp;</td>
      </tr>
      <tr>
        <td width="15%" height="30" align="right"><span class="f_8"><span class="f_11">*</span></span> 帐号：</td>
        <td width="26%" align="left"><input id="account" type="text" name="user.account" value="${user.account }" disabled="disabled" /></td>
        <td width="56%" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 帐号:请用英文小写、数字、下划线等字符。</td>
          </tr>
        </table></td>
        <td width="3%" align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right"><span class="f_8"><span class="f_11">*</span></span> 姓名：</td>
        <td align="left"><input id="name" type="text" name="user.name" value="${user.name }" /></td>
        <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 姓名:请用字母、汉字、数字等字符</td>
          </tr>
        </table></td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">输入密码：</td>
        <td align="left"><input id="pwd" type="password" name="user.password" value="${user.password }" /></td>
        <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 密码:为0―10位,限用英文、数字等符号,不填与帐号一致。</td>
          </tr>
        </table></td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">性别：</td>
        <td align="left"><span id="sexspan"></span></td>
        <td align="left">&nbsp;</td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">手机号码：</td>
        <td align="left"><input id="mobileNumber1" type="text" name="user.mobileNumber1" value="${user.mobileNumber1 }" /></td>
        <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 请填写手机号。</td>
          </tr>
        </table></td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">身份证号：</td>
        <td align="left"><input id="idNumber" type="text" name="user.idNumber" value="${user.idNumber }" /></td>
        <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 请填写身份证号。</td>
          </tr>
        </table></td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">电子邮件：</td>
        <td align="left"><input id="email" type="text" name="user.email" value="${user.email }" /></td>
        <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" class="tb_11 border_4 f_8"><img src="<%=path%>/images/icon_21.gif" width="15" height="15" align="absmiddle" /> 填写有效的电子邮箱地址。</td>
          </tr>
        </table></td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right">家庭地址：</td>
        <td align="left"><input id="address" type="text" name="user.address" value="${user.address }" /></td>
        <td align="left">&nbsp;</td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="4" align="center">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="4" align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="1" bgcolor="#ABA899"></td>
          </tr>
          <tr>
            <td height="1" bgcolor="#FFFFFF"></td>
          </tr>
        </table></td>
        </tr>
      <tr>
        <td height="30" colspan="3" align="center"><input type="button" onclick="doSubmitForm();" name="Submit" value="提 交" /></td>
        <td align="left">&nbsp;</td>
      </tr>
      
    </table></td>
  </tr>
</table>
</form>
  </body>
</html>
